﻿namespace OboutInc.Show
{
    using System;
    using System.ComponentModel;
    using System.Drawing;
    using System.Drawing.Design;
    using System.IO;
    using System.Runtime.Serialization;
    using System.Text;
    using System.Text.RegularExpressions;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Xml;

    [ToolboxBitmap(typeof(OboutInc.Show.Show), "show.bmp"), Designer("OboutInc.Show.Design.ShowDesigner"), DefaultProperty("Panels"), PersistChildren(false), ParseChildren(true), ToolboxData("<{0}:Show runat=\"server\">\n</{0}:Show>")]
    public class Show : Control, INamingContainer, ISerializable
    {
        private string _ClientID = string.Empty;
        private string _cssShowChanger = string.Empty;
        private string _cssShowChangerBottom = string.Empty;
        private string _cssShowChangerBottomOver = string.Empty;
        private string _cssShowChangerLeft = string.Empty;
        private string _cssShowChangerLeftOver = string.Empty;
        private string _cssShowChangerNumber = string.Empty;
        private string _cssShowChangerNumberOver = string.Empty;
        private string _cssShowChangerNumberSelected = string.Empty;
        private string _cssShowChangerPause = string.Empty;
        private string _cssShowChangerPauseOver = string.Empty;
        private string _cssShowChangerPlay = string.Empty;
        private string _cssShowChangerPlayOver = string.Empty;
        private string _cssShowChangerRight = string.Empty;
        private string _cssShowChangerRightOver = string.Empty;
        private string _cssShowChangerTop = string.Empty;
        private string _cssShowChangerTopOver = string.Empty;
        private string _cssShowPanel = string.Empty;
        private string _cssShowPanelsHolder = string.Empty;
        private string changerAlign = string.Empty;
        private string changerHeight = string.Empty;
        private string changerWidth = string.Empty;
        private string panelHeight = string.Empty;
        private string panelWidth = string.Empty;
        private string pixelSrc = string.Empty;

        public int AddHtmlPanel(string InnerHtml)
        {
            return this.Panels.Add(new OboutInc.Show.Panel(InnerHtml, PanelType.InnerHtml));
        }

        public int AddHtmlPanel(string InnerHtml, bool selected)
        {
            return this.Panels.Add(new OboutInc.Show.Panel(InnerHtml, selected, PanelType.InnerHtml));
        }

        public void AddHtmlPanelAt(int index, string InnerHtml)
        {
            this.Panels.Insert(index, new OboutInc.Show.Panel(InnerHtml, PanelType.InnerHtml));
        }

        public void AddHtmlPanelAt(int index, string InnerHtml, bool selected)
        {
            this.Panels.Insert(index, new OboutInc.Show.Panel(InnerHtml, selected, PanelType.InnerHtml));
        }

        public int AddImagePanel(string imagePath)
        {
            return this.Panels.Add(new OboutInc.Show.Panel(imagePath, PanelType.ImagePath));
        }

        public int AddImagePanel(string imagePath, string imageTitle, string imageWidth, string imageHeight, bool selected)
        {
            OboutInc.Show.Panel panel = new OboutInc.Show.Panel(imagePath, imageTitle, selected, PanelType.ImagePath) {
                ImageWidth = imageWidth,
                ImageHeight = imageHeight
            };
            return this.Panels.Add(panel);
        }

        public void AddImagePanelAt(int index, string imagePath)
        {
            this.Panels.Insert(index, new OboutInc.Show.Panel(imagePath, PanelType.ImagePath));
        }

        public void AddImagePanelAt(int index, string imagePath, string imageTitle, string imageWidth, string imageHeight, bool selected)
        {
            OboutInc.Show.Panel panel = new OboutInc.Show.Panel(imagePath, imageTitle, selected, PanelType.ImagePath) {
                ImageWidth = imageWidth,
                ImageHeight = imageHeight
            };
            this.Panels.Insert(index, panel);
        }

        public int AddPanel(OboutInc.Show.Panel panel)
        {
            return this.Panels.Add(panel);
        }

        public void AddPanelAt(int index, OboutInc.Show.Panel panel)
        {
            this.Panels.Insert(index, panel);
        }

        public int AddUrlPanel(string Url)
        {
            return this.Panels.Add(new OboutInc.Show.Panel(Url, PanelType.Url));
        }

        public int AddUrlPanel(string Url, bool selected)
        {
            return this.Panels.Add(new OboutInc.Show.Panel(Url, selected, PanelType.Url));
        }

        public void AddUrlPanelAt(int index, string Url)
        {
            this.Panels.Insert(index, new OboutInc.Show.Panel(Url, PanelType.Url));
        }

        public void AddUrlPanelAt(int index, string Url, bool selected)
        {
            this.Panels.Insert(index, new OboutInc.Show.Panel(Url, selected, PanelType.Url));
        }

        protected override void CreateChildControls()
        {
        }

        private void deserializeChanger()
        {
            if (this.ViewState["Show_Changer"] != null)
            {
                XmlDocument document = new XmlDocument();
                OboutInc.Show.Changer changer = new OboutInc.Show.Changer();
                document.LoadXml((string) this.ViewState["Show_Changer"]);
                if (document.DocumentElement.HasChildNodes)
                {
                    XmlNodeList childNodes = document.DocumentElement.ChildNodes;
                    changer.Deserialize((XmlElement) childNodes[0]);
                    this.Changer = changer;
                }
            }
        }

        private string FixupUrl(string Url)
        {
            if (Url.StartsWith("~"))
            {
                return (this.Page.Request.ApplicationPath + Url.Substring(1)).Replace("//", "/");
            }
            return Url;
        }

        private int InternalAddPanel(OboutInc.Show.Panel panel)
        {
            return this.Panels.Add(panel);
        }

        protected override void LoadViewState(object savedState)
        {
            base.LoadViewState(savedState);
            this.deserializeChanger();
        }

        protected override void OnInit(EventArgs e)
        {
            if ((this.Panels != null) && (this.Panels.Count > 0))
            {
                foreach (OboutInc.Show.Panel panel in this.Panels)
                {
                    this.Controls.Add(panel);
                }
            }
            base.OnInit(e);
        }

        protected override void OnPreRender(EventArgs e)
        {
            if (this.StyleFolder != string.Empty)
            {
                this.CSSPath = Path.Combine(this.StyleFolder, "style.css");
                this.CSSPath = this.CSSPath.Replace(@"\", "/");
                this.CSSPath = base.ResolveUrl(this.CSSPath);
            }
            if (this.CSSPath != string.Empty)
            {
                string str = "<link rel=\"stylesheet\" href=\"" + this.CSSPath + "\" media=\"screen\" type=\"text/css\"></link>";
                if (this.Page.Header != null)
                {
                    Literal child = new Literal {
                        Text = str
                    };
                    this.Page.Header.Controls.Add(child);
                }
            }
            base.OnPreRender(e);
        }

        private string RandomString(int size)
        {
            StringBuilder builder = new StringBuilder();
            Random random = new Random();
            for (int i = 0; i < size; i++)
            {
                char ch = Convert.ToChar(Convert.ToInt32((double) ((26.0 * random.NextDouble()) + 65.0)));
                builder.Append(ch);
            }
            return builder.ToString().ToLower();
        }

        public void RemovePanel(OboutInc.Show.Panel panel)
        {
            this.Panels.Remove(panel);
        }

        public void RemovePanelAt(int index)
        {
            this.Panels.RemoveAt(index);
        }

        protected override void Render(HtmlTextWriter writer)
        {
            bool flag = false;
            string str = "";
            if (DateTime.Compare(DateTime.Now, Constants.expirationDate) >= 0)
            {
                flag = true;
            }
            str = this.RandomString(8);
            if (this.ImagesShowPath != string.Empty)
            {
                if (!this.ImagesShowPath.EndsWith("/"))
                {
                    this.ImagesShowPath = this.ImagesShowPath + "/";
                }
                this.ImagesShowPath = this.FixupUrl(this.ImagesShowPath);
                try
                {
                    DirectoryInfo info = new DirectoryInfo(base.Page.MapPath(this.ImagesShowPath));
                    foreach (FileInfo info2 in info.GetFiles())
                    {
                        if (Enum.IsDefined(typeof(ImagesType), info2.Extension.ToLower().Replace(".", string.Empty)))
                        {
                            Regex regex = new Regex(this.ImagesShowPattern, RegexOptions.IgnoreCase);
                            if (regex.IsMatch(info2.Name))
                            {
                                string imagePath = this.ImagesShowPath + info2.Name;
                                this.AddImagePanel(imagePath, string.Empty, string.Empty, string.Empty, false);
                            }
                        }
                    }
                }
                catch
                {
                }
            }
            writer.Write("\n\n<!--   obout inc Show version " + Constants.myVersion + "  http://www.obout.com   -->\n\n");
            writer.Write("<span style=\"display:none\">&nbsp;</span>");
            string str3 = this.Page.ClientScript.GetWebResourceUrl(base.GetType(), "OboutInc.Show.Resources.oboutShow.min.js").Replace("&", "&amp;");
            ScriptManagerHelper helper = new ScriptManagerHelper(this);
            if (helper.IsAjax && helper.IsInAsyncCallback)
            {
                helper.RegisterClientScriptResource(this, "OboutInc.Show.Resources.oboutShow.min.js");
            }
            else
            {
                writer.Write("<script type=\"text/javascript\" src=\"" + str3 + "\"></script>");
            }
            this.pixelSrc = this.Page.ClientScript.GetWebResourceUrl(base.GetType(), "OboutInc.Show.Resources.pixel.gif");
            this.pixelSrc = this.pixelSrc.Replace("&", "&amp;");
            this._cssShowPanelsHolder = (this.CSSShowPanelsHolder == string.Empty) ? "ob_show_panelsholder" : this.CSSShowPanelsHolder;
            this._cssShowPanel = (this.CSSShowPanel == string.Empty) ? "ob_show_panel" : this.CSSShowPanel;
            this._cssShowChanger = (this.CSSShowChanger == string.Empty) ? "ob_show_changer" : this.CSSShowChanger;
            this._cssShowChangerPlay = (this.CSSShowChangerPlay == string.Empty) ? "ob_show_changerplay" : this.CSSShowChangerPlay;
            this._cssShowChangerPlayOver = (this.CSSShowChangerPlayOver == string.Empty) ? "ob_show_changerplay_over" : this.CSSShowChangerPlayOver;
            this._cssShowChangerPause = (this.CSSShowChangerPause == string.Empty) ? "ob_show_changerpause" : this.CSSShowChangerPause;
            this._cssShowChangerPauseOver = (this.CSSShowChangerPauseOver == string.Empty) ? "ob_show_changerpause_over" : this.CSSShowChangerPauseOver;
            this._cssShowChangerLeft = (this.CSSShowChangerLeft == string.Empty) ? "ob_show_changerleft" : this.CSSShowChangerLeft;
            this._cssShowChangerLeftOver = (this.CSSShowChangerLeftOver == string.Empty) ? "ob_show_changerleft_over" : this.CSSShowChangerLeftOver;
            this._cssShowChangerRight = (this.CSSShowChangerRight == string.Empty) ? "ob_show_changerright" : this.CSSShowChangerRight;
            this._cssShowChangerRightOver = (this.CSSShowChangerRightOver == string.Empty) ? "ob_show_changerright_over" : this.CSSShowChangerRightOver;
            this._cssShowChangerTop = (this.CSSShowChangerTop == string.Empty) ? "ob_show_changertop" : this.CSSShowChangerTop;
            this._cssShowChangerTopOver = (this.CSSShowChangerTopOver == string.Empty) ? "ob_show_changertop_over" : this.CSSShowChangerTopOver;
            this._cssShowChangerBottom = (this.CSSShowChangerBottom == string.Empty) ? "ob_show_changerbottom" : this.CSSShowChangerBottom;
            this._cssShowChangerBottomOver = (this.CSSShowChangerBottomOver == string.Empty) ? "ob_show_changerbottom_over" : this.CSSShowChangerBottomOver;
            this._cssShowChangerNumber = (this.CSSShowChangerNumber == string.Empty) ? "ob_show_changernumber" : this.CSSShowChangerNumber;
            this._cssShowChangerNumberOver = (this.CSSShowChangerNumberOver == string.Empty) ? "ob_show_changernumber_over" : this.CSSShowChangerNumberOver;
            this._cssShowChangerNumberSelected = (this.CSSShowChangerNumberSelected == string.Empty) ? "ob_show_changernumber_selected" : this.CSSShowChangerNumberSelected;
            if (this.CSSPath == string.Empty)
            {
                writer.Write("<style type=\"text/css\">");
                OboutInc.Show.Style.play = this.Page.ClientScript.GetWebResourceUrl(base.GetType(), "OboutInc.Show.Resources.play.gif");
                OboutInc.Show.Style.play = OboutInc.Show.Style.play.Replace("&", "&amp;");
                OboutInc.Show.Style.pause = this.Page.ClientScript.GetWebResourceUrl(base.GetType(), "OboutInc.Show.Resources.pause.gif");
                OboutInc.Show.Style.pause = OboutInc.Show.Style.pause.Replace("&", "&amp;");
                OboutInc.Show.Style.arrow_left = this.Page.ClientScript.GetWebResourceUrl(base.GetType(), "OboutInc.Show.Resources.arrow_left.gif");
                OboutInc.Show.Style.arrow_left = OboutInc.Show.Style.arrow_left.Replace("&", "&amp;");
                OboutInc.Show.Style.arrow_right = this.Page.ClientScript.GetWebResourceUrl(base.GetType(), "OboutInc.Show.Resources.arrow_right.gif");
                OboutInc.Show.Style.arrow_right = OboutInc.Show.Style.arrow_right.Replace("&", "&amp;");
                OboutInc.Show.Style.arrow_top = this.Page.ClientScript.GetWebResourceUrl(base.GetType(), "OboutInc.Show.Resources.arrow_top.gif");
                OboutInc.Show.Style.arrow_top = OboutInc.Show.Style.arrow_top.Replace("&", "&amp;");
                OboutInc.Show.Style.arrow_bottom = this.Page.ClientScript.GetWebResourceUrl(base.GetType(), "OboutInc.Show.Resources.arrow_bottom.gif");
                OboutInc.Show.Style.arrow_bottom = OboutInc.Show.Style.arrow_bottom.Replace("&", "&amp;");
                writer.Write(OboutInc.Show.Style.GetStyle);
                writer.Write("</style>");
            }
            else
            {
                string str4 = "<link rel=\"stylesheet\" href=\"" + this.CSSPath + "\" media=\"screen\" type=\"text/css\"></link>";
                if (this.Page.Header == null)
                {
                    writer.Write(str4);
                }
            }
            string str5 = "{'CSSShowChangerNumber':'" + this._cssShowChangerNumber + "', 'CSSShowChangerNumberOver':'" + this._cssShowChangerNumberOver + "', 'CSSShowChangerNumberSelected':'" + this._cssShowChangerNumberSelected + "'}";
            string str6 = "{'OnPanelChangeStartEvent':'" + this.OnPanelChangeStartEvent + "', 'OnPanelChangeEndEvent':'" + this.OnPanelChangeEndEvent + "'}";
            if (!helper.IsAjax)
            {
                writer.Write("<script type=\"text/javascript\">");
                writer.Write("var " + this.ClientID + " = new obout_Show(\"" + this.ClientID + "\"");
                writer.Write(", ");
                writer.Write(this.Panels.Count);
                writer.Write(", ");
                writer.Write("\"" + this.Width + "\"");
                writer.Write(", ");
                writer.Write("\"" + this.Height + "\"");
                writer.Write(", ");
                writer.Write("\"" + this.ShowType + "\"");
                writer.Write(", ");
                writer.Write(this.TimeBetweenPanels);
                writer.Write(", ");
                writer.Write(this.StartTimeDelay);
                writer.Write(", ");
                writer.Write("\"" + this.TransitionType + "\"");
                writer.Write(", ");
                writer.Write("\"" + this.ScrollDirection + "\"");
                writer.Write(", ");
                writer.Write(this.FixedScrolling ? "true" : "false");
                writer.Write(", ");
                writer.Write(this.StopScrolling ? "true" : "false");
                writer.Write(", ");
                writer.Write(this.StopFading ? "true" : "false");
                writer.Write(", ");
                writer.Write(this.ImagesFitAvailableSize ? "true" : "false");
                writer.Write(", ");
                writer.Write(this.RefreshOnLoad ? "true" : "false");
                writer.Write(", ");
                writer.Write(this.FadeFirstPanel ? "true" : "false");
                writer.Write(", ");
                writer.Write("\"" + this.Changer.Position + "\"");
                writer.Write(", ");
                writer.Write(this.FadingSpeed);
                writer.Write(", ");
                writer.Write(this.FadingStep);
                writer.Write(", ");
                writer.Write(this.ScrollingSpeed);
                writer.Write(", ");
                writer.Write(this.ScrollingStep);
                writer.Write(", ");
                writer.Write(this.SelectedPanel);
                writer.Write(", ");
                writer.Write(str5);
                writer.Write(", ");
                writer.Write(str6);
                writer.Write(")");
                writer.Write("</script>");
            }
            else
            {
                StringBuilder builder = new StringBuilder();
                builder.Append("var " + this.ClientID + " = new obout_Show(\"" + this.ClientID + "\"");
                builder.Append(", ");
                builder.Append(this.Panels.Count);
                builder.Append(", ");
                builder.Append("\"" + this.Width + "\"");
                builder.Append(", ");
                builder.Append("\"" + this.Height + "\"");
                builder.Append(", ");
                builder.Append("\"" + this.ShowType + "\"");
                builder.Append(", ");
                builder.Append(this.TimeBetweenPanels);
                builder.Append(", ");
                builder.Append(this.StartTimeDelay);
                builder.Append(", ");
                builder.Append("\"" + this.TransitionType + "\"");
                builder.Append(", ");
                builder.Append("\"" + this.ScrollDirection + "\"");
                builder.Append(", ");
                builder.Append(this.FixedScrolling ? "true" : "false");
                builder.Append(", ");
                builder.Append(this.StopScrolling ? "true" : "false");
                builder.Append(", ");
                builder.Append(this.StopFading ? "true" : "false");
                builder.Append(", ");
                builder.Append(this.ImagesFitAvailableSize ? "true" : "false");
                builder.Append(", ");
                builder.Append(this.RefreshOnLoad ? "true" : "false");
                builder.Append(", ");
                builder.Append(this.FadeFirstPanel ? "true" : "false");
                builder.Append(", ");
                builder.Append("\"" + this.Changer.Position + "\"");
                builder.Append(", ");
                builder.Append(this.FadingSpeed);
                builder.Append(", ");
                builder.Append(this.FadingStep);
                builder.Append(", ");
                builder.Append(this.ScrollingSpeed);
                builder.Append(", ");
                builder.Append(this.ScrollingStep);
                builder.Append(", ");
                builder.Append(this.SelectedPanel);
                builder.Append(", ");
                builder.Append(str5);
                builder.Append(", ");
                builder.Append(str6);
                builder.Append(", ");
                builder.Append("true");
                builder.Append(");");
                helper.RegisterStartupScript(this, "ShowScript" + this.ID, builder.ToString(), true);
            }
            string width = this.Width;
            string height = this.Height;
            writer.Write("<div class=\"" + this._cssShowPanelsHolder + "\" style=\"display:none;overflow:hidden;position:relative;width:" + width + ";height:" + height + "\" id=\"" + this.ClientID + "\">");
            writer.Write("<table border='0' width='100%' class=\"changerTable\" cellpadding=\"0\" cellspacing=\"0\">");
            this.panelHeight = "100%";
            this.panelWidth = "100%";
            if (this.ManualChanger)
            {
                this.RenderPanelWithChanger(writer);
            }
            else
            {
                writer.Write("<tr>");
                writer.Write("<td style='width:100%;height:100%'>");
                this.RenderPanels(writer);
                writer.Write("</td>");
                writer.Write("</tr>");
            }
            writer.Write("</table>");
            writer.Write("</div>");
            if (flag && Constants.isTrial)
            {
                writer.Write("<div id=\"" + str + "\" style=\"position:absolute; top:0px; left:0px; border:1px solid gray; background-color:white; padding:5px; color:gray; font:11px Verdana; text-align:center;\">");
                writer.Write("obout Show has expired.<br />");
                writer.Write("<a href=\"http://www.obout.com\">obout.com</a>");
                writer.Write("</div>");
                writer.Write("<script language=\"javascript\">");
                writer.Write("document.getElementById(\"" + str + "\").style.left=" + this.ClientID + ".getLeft(document.getElementById(\"" + this.ClientID + "\"))+\"px\";");
                writer.Write("document.getElementById(\"" + str + "\").style.top=" + this.ClientID + ".getTop(document.getElementById(\"" + this.ClientID + "\"))+\"px\";");
                writer.Write("</script>");
            }
            writer.Write("<img alt=\"\" class=\"" + this._cssShowChangerNumberOver + "\" src=\"" + this.pixelSrc + "\" border=\"0\" style=\"display:none\" />");
            writer.Write("<img alt=\"\" class=\"" + this._cssShowChangerPauseOver + "\" src=\"" + this.pixelSrc + "\" border=\"0\" style=\"display:none\" />");
            writer.Write("<img alt=\"\" class=\"" + this._cssShowChangerPlayOver + "\" src=\"" + this.pixelSrc + "\" border=\"0\" style=\"display:none\" />");
            writer.Write("<img alt=\"\" class=\"" + this._cssShowChangerLeftOver + "\" src=\"" + this.pixelSrc + "\" border=\"0\" style=\"display:none\" />");
            writer.Write("<img alt=\"\" class=\"" + this._cssShowChangerRightOver + "\" src=\"" + this.pixelSrc + "\" border=\"0\" style=\"display:none\" />");
            writer.Write("<img alt=\"\" class=\"" + this._cssShowChangerTopOver + "\" src=\"" + this.pixelSrc + "\" border=\"0\" style=\"display:none\" />");
            writer.Write("<img alt=\"\" class=\"" + this._cssShowChangerBottomOver + "\" src=\"" + this.pixelSrc + "\" border=\"0\" style=\"display:none\" />");
            this.NoJavaScript.RenderControl(writer);
        }

        private void RenderChangerPanel(HtmlTextWriter writer)
        {
            int num3;
            if ((this.Changer.Position == ChangerPosition.Top) || (this.Changer.Position == ChangerPosition.Bottom))
            {
                writer.Write("<div align=\"" + this.changerAlign + "\" class=\"" + this._cssShowChanger + "\" style=\"width:" + this.changerWidth + ";height:" + this.changerHeight + ";\">");
            }
            else
            {
                writer.Write("<div align=\"center\" class=\"" + this._cssShowChanger + "\" style=\"width:" + this.changerWidth + ";height:" + this.changerHeight + ";\">");
            }
            if ((this.Changer.Position == ChangerPosition.Left) || (this.Changer.Position == ChangerPosition.Right))
            {
                string str = "vertical-align:" + this.changerAlign;
                writer.Write("<table cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">");
                writer.Write("<tr>");
                writer.Write("<td style=\"" + str + ";width:100%;height:100%;\">");
            }
            else
            {
                string str2 = "vertical-align:middle";
                writer.Write("<table cellpadding=\"0\" cellspacing=\"0\">");
                writer.Write("<tr>");
                writer.Write("<td style=\"" + str2 + ";width:100%;height:100%;\">");
            }
            switch (this.Changer.Type)
            {
                case ChangerType.Arrow:
                    if ((this.Changer.Position == ChangerPosition.Top) || (this.Changer.Position == ChangerPosition.Bottom))
                    {
                        if (this.ShowType == OboutInc.Show.ShowType.Show)
                        {
                            writer.Write("<img id=\"" + this.ClientID + "_autoplaypause\" alt=\"" + this.Changer.PauseTitle + "\" title=\"" + this.Changer.PauseTitle + "\" onclick=\"" + this.ClientID + ".PauseShow();\" class=\"" + this._cssShowChangerPause + "\" onmouseover=\"this.className='" + this._cssShowChangerPauseOver + "'\" onmouseout=\"this.className='" + this._cssShowChangerPause + "'\" src=\"" + this.pixelSrc + "\" border=\"0\" />");
                            writer.Write("<img id=\"" + this.ClientID + "_autoplaystart\" style=\"display:none\" alt=\"" + this.Changer.StartTitle + "\" title=\"" + this.Changer.StartTitle + "\" onclick=\"" + this.ClientID + ".PlayShow();\" class=\"" + this._cssShowChangerPlay + "\" onmouseover=\"this.className='" + this._cssShowChangerPlayOver + "'\" onmouseout=\"this.className='" + this._cssShowChangerPlay + "'\" src=\"" + this.pixelSrc + "\" border=\"0\" />");
                            writer.Write("<img alt=\"" + this.Changer.MoveLeftTitle + "\" title=\"" + this.Changer.MoveLeftTitle + "\" onclick=\"" + this.ClientID + ".MoveBackward();\" class=\"" + this._cssShowChangerLeft + "\" onmouseover=\"this.className='" + this._cssShowChangerLeftOver + "'\" onmouseout=\"this.className='" + this._cssShowChangerLeft + "'\" src=\"" + this.pixelSrc + "\" border=\"0\" />");
                            writer.Write("<img alt=\"" + this.Changer.MoveRightTitle + "\" title=\"" + this.Changer.MoveRightTitle + "\" onclick=\"" + this.ClientID + ".MoveForward();\" class=\"" + this._cssShowChangerRight + "\" onmouseover=\"this.className='" + this._cssShowChangerRightOver + "'\" onmouseout=\"this.className='" + this._cssShowChangerRight + "'\" src=\"" + this.pixelSrc + "\" border=\"0\" />");
                        }
                        else
                        {
                            writer.Write("<img alt=\"" + this.Changer.MoveLeftTitle + "\" title=\"" + this.Changer.MoveLeftTitle + "\" onclick=\"" + this.ClientID + ".MoveBackward();\" class=\"" + this._cssShowChangerLeft + "\" onmouseover=\"this.className='" + this._cssShowChangerLeftOver + "'\" onmouseout=\"this.className='" + this._cssShowChangerLeft + "'\" src=\"" + this.pixelSrc + "\" border=\"0\" />");
                            writer.Write("<img alt=\"" + this.Changer.MoveRightTitle + "\" title=\"" + this.Changer.MoveRightTitle + "\" onclick=\"" + this.ClientID + ".MoveForward();\" class=\"" + this._cssShowChangerRight + "\" onmouseover=\"this.className='" + this._cssShowChangerRightOver + "'\" onmouseout=\"this.className='" + this._cssShowChangerRight + "'\" src=\"" + this.pixelSrc + "\" border=\"0\" />");
                        }
                    }
                    if ((this.Changer.Position == ChangerPosition.Left) || (this.Changer.Position == ChangerPosition.Right))
                    {
                        writer.Write("<div align=\"center\">");
                        if (this.ShowType == OboutInc.Show.ShowType.Show)
                        {
                            writer.Write("<img id=\"" + this.ClientID + "_autoplaypause\" alt=\"" + this.Changer.PauseTitle + "\" title=\"" + this.Changer.PauseTitle + "\" onclick=\"" + this.ClientID + ".PauseShow();\" class=\"" + this._cssShowChangerPause + "\" onmouseover=\"this.className='" + this._cssShowChangerPauseOver + "'\" onmouseout=\"this.className='" + this._cssShowChangerPause + "'\" src=\"" + this.pixelSrc + "\" border=\"0\" />");
                            writer.Write("<img id=\"" + this.ClientID + "_autoplaystart\" style=\"display:none\" alt=\"" + this.Changer.StartTitle + "\" title=\"" + this.Changer.StartTitle + "\" onclick=\"" + this.ClientID + ".PlayShow();\" class=\"" + this._cssShowChangerPlay + "\" onmouseover=\"this.className='" + this._cssShowChangerPlayOver + "'\" onmouseout=\"this.className='" + this._cssShowChangerPlay + "'\" src=\"" + this.pixelSrc + "\" border=\"0\" />");
                            writer.Write("<img alt=\"" + this.Changer.MoveLeftTitle + "\" title=\"" + this.Changer.MoveLeftTitle + "\" onclick=\"" + this.ClientID + ".MoveBackward();\" class=\"" + this._cssShowChangerTop + "\" onmouseover=\"this.className='" + this._cssShowChangerTopOver + "'\" onmouseout=\"this.className='" + this._cssShowChangerTop + "'\" src=\"" + this.pixelSrc + "\" border=\"0\" style=\"display:block\" />");
                            writer.Write("<img alt=\"" + this.Changer.MoveRightTitle + "\" title=\"" + this.Changer.MoveRightTitle + "\" onclick=\"" + this.ClientID + ".MoveForward();\" class=\"" + this._cssShowChangerBottom + "\" onmouseover=\"this.className='" + this._cssShowChangerBottomOver + "'\" onmouseout=\"this.className='" + this._cssShowChangerBottom + "'\" src=\"" + this.pixelSrc + "\" border=\"0\" />");
                        }
                        else
                        {
                            writer.Write("<img alt=\"" + this.Changer.MoveLeftTitle + "\" title=\"" + this.Changer.MoveLeftTitle + "\" onclick=\"" + this.ClientID + ".MoveBackward();\" class=\"" + this._cssShowChangerTop + "\" onmouseover=\"this.className='" + this._cssShowChangerTopOver + "'\" onmouseout=\"this.className='" + this._cssShowChangerTop + "'\" src=\"" + this.pixelSrc + "\" border=\"0\" style=\"display:block\" />");
                            writer.Write("<img alt=\"" + this.Changer.MoveRightTitle + "\" title=\"" + this.Changer.MoveRightTitle + "\" onclick=\"" + this.ClientID + ".MoveForward();\" class=\"" + this._cssShowChangerBottom + "\" onmouseover=\"this.className='" + this._cssShowChangerBottomOver + "'\" onmouseout=\"this.className='" + this._cssShowChangerBottom + "'\" src=\"" + this.pixelSrc + "\" border=\"0\" />");
                        }
                        writer.Write("</div>");
                    }
                    goto Label_2E32;

                case ChangerType.Number:
                    if ((this.Changer.Position == ChangerPosition.Top) || (this.Changer.Position == ChangerPosition.Bottom))
                    {
                        writer.Write("<table cellpadding=\"0\" cellspacing=\"0\"><tr>");
                        for (int i = 0; i < this.Panels.Count; i++)
                        {
                            writer.Write("<td style=\"vertical-align:middle;text-align:center\"><table cellpadding=\"0\" cellspacing=\"0\"><tr>");
                            writer.Write(string.Concat(new object[] { "<td id=\"", this.ClientID, "_panelnumber_", i, "\" onclick=\"", this.ClientID, ".MoveToPanel(", i + 1, ")\" style=\"vertical-align:middle;text-align:center\">" }));
                            writer.Write((int) (i + 1));
                            writer.Write("</td>");
                            writer.Write("</tr></table></td>");
                        }
                        writer.Write("</tr></table>");
                    }
                    if ((this.Changer.Position == ChangerPosition.Left) || (this.Changer.Position == ChangerPosition.Right))
                    {
                        writer.Write("<div align=\"center\">");
                        for (int j = 0; j < this.Panels.Count; j++)
                        {
                            writer.Write("<table cellpadding=\"0\" cellspacing=\"0\"><tr>");
                            writer.Write(string.Concat(new object[] { "<td id=\"", this.ClientID, "_panelnumber_", j, "\" onclick=\"", this.ClientID, ".MoveToPanel(", j + 1, ")\" style=\"vertical-align:middle;text-align:center\">" }));
                            writer.Write((int) (j + 1));
                            writer.Write("</td>");
                            writer.Write("</tr></table>");
                        }
                        writer.Write("</div>");
                    }
                    goto Label_2E32;

                case ChangerType.Both:
                    if ((this.Changer.Position == ChangerPosition.Top) || (this.Changer.Position == ChangerPosition.Bottom))
                    {
                        switch (this.Changer.ArrowType)
                        {
                            case ArrowType.Side1:
                                writer.Write("<table cellpadding=\"0\" cellspacing=\"0\"><tr>");
                                if (this.ShowType != OboutInc.Show.ShowType.Show)
                                {
                                    writer.Write("<td>");
                                    writer.Write("<img alt=\"" + this.Changer.MoveLeftTitle + "\" title=\"" + this.Changer.MoveLeftTitle + "\" onclick=\"" + this.ClientID + ".MoveBackward();\" class=\"" + this._cssShowChangerLeft + "\" onmouseover=\"this.className='" + this._cssShowChangerLeftOver + "'\" onmouseout=\"this.className='" + this._cssShowChangerLeft + "'\" src=\"" + this.pixelSrc + "\" border=\"0\" />");
                                    writer.Write("</td>");
                                    writer.Write("<td>");
                                    writer.Write("<img alt=\"" + this.Changer.MoveRightTitle + "\" title=\"" + this.Changer.MoveRightTitle + "\" onclick=\"" + this.ClientID + ".MoveForward();\" class=\"" + this._cssShowChangerRight + "\" onmouseover=\"this.className='" + this._cssShowChangerRightOver + "'\" onmouseout=\"this.className='" + this._cssShowChangerRight + "'\" src=\"" + this.pixelSrc + "\" border=\"0\" />");
                                    writer.Write("</td>");
                                }
                                else
                                {
                                    writer.Write("<td style='vertical-align:middle'>");
                                    writer.Write("<img alt=\"" + this.Changer.PauseTitle + "\" title=\"" + this.Changer.PauseTitle + "\" onclick=\"" + this.ClientID + ".PauseShow();\" class=\"" + this._cssShowChangerPause + "\" id=\"" + this.ClientID + "_autoplaypause\"    onmouseover=\"this.className='" + this._cssShowChangerPauseOver + "'\" onmouseout=\"this.className='" + this._cssShowChangerPause + "'\" src=\"" + this.pixelSrc + "\" border=\"0\" />");
                                    writer.Write("<img id=\"" + this.ClientID + "_autoplaystart\" style=\"display:none\" alt=\"" + this.Changer.StartTitle + "\" title=\"" + this.Changer.StartTitle + "\" onclick=\"" + this.ClientID + ".PlayShow();\" class=\"" + this._cssShowChangerPlay + "\" onmouseover=\"this.className='" + this._cssShowChangerPlayOver + "'\" onmouseout=\"this.className='" + this._cssShowChangerPlay + "'\" src=\"" + this.pixelSrc + "\" border=\"0\" />");
                                    writer.Write("</td>");
                                    writer.Write("<td style='vertical-align:middle'>");
                                    writer.Write("<img alt=\"" + this.Changer.MoveLeftTitle + "\" title=\"" + this.Changer.MoveLeftTitle + "\" onclick=\"" + this.ClientID + ".MoveBackward();\" class=\"" + this._cssShowChangerLeft + "\" onmouseover=\"this.className='" + this._cssShowChangerLeftOver + "'\" onmouseout=\"this.className='" + this._cssShowChangerLeft + "'\" src=\"" + this.pixelSrc + "\" border=\"0\" />");
                                    writer.Write("</td>");
                                    writer.Write("<td style='vertical-align:middle'>");
                                    writer.Write("<img alt=\"" + this.Changer.MoveRightTitle + "\" title=\"" + this.Changer.MoveRightTitle + "\" onclick=\"" + this.ClientID + ".MoveForward();\" class=\"" + this._cssShowChangerRight + "\" onmouseover=\"this.className='" + this._cssShowChangerRightOver + "'\" onmouseout=\"this.className='" + this._cssShowChangerRight + "'\" src=\"" + this.pixelSrc + "\" border=\"0\" />");
                                    writer.Write("</td>");
                                }
                                goto Label_11CF;

                            case ArrowType.Side2:
                                writer.Write("<table cellpadding=\"0\" cellspacing=\"0\"><tr>");
                                for (int k = 0; k < this.Panels.Count; k++)
                                {
                                    writer.Write("<td style=\"vertical-align:middle;text-align:center\"><table cellpadding=\"0\" cellspacing=\"0\"><tr>");
                                    writer.Write(string.Concat(new object[] { "<td id=\"", this.ClientID, "_panelnumber_", k, "\" onclick=\"", this.ClientID, ".MoveToPanel(", k + 1, ")\" style=\"vertical-align:middle;text-align:center\">" }));
                                    writer.Write((int) (k + 1));
                                    writer.Write("</td>");
                                    writer.Write("</tr></table></td>");
                                }
                                if (this.ShowType == OboutInc.Show.ShowType.Show)
                                {
                                    writer.Write("<td>");
                                    writer.Write("<img id=\"" + this.ClientID + "_autoplaypause\" alt=\"" + this.Changer.PauseTitle + "\" title=\"" + this.Changer.PauseTitle + "\" onclick=\"" + this.ClientID + ".PauseShow();\" class=\"" + this._cssShowChangerPause + "\" onmouseover=\"this.className='" + this._cssShowChangerPauseOver + "'\" onmouseout=\"this.className='" + this._cssShowChangerPause + "'\" src=\"" + this.pixelSrc + "\" border=\"0\" />");
                                    writer.Write("<img id=\"" + this.ClientID + "_autoplaystart\" style=\"display:none\" alt=\"" + this.Changer.StartTitle + "\" title=\"" + this.Changer.StartTitle + "\" onclick=\"" + this.ClientID + ".PlayShow();\" class=\"" + this._cssShowChangerPlay + "\" onmouseover=\"this.className='" + this._cssShowChangerPlayOver + "'\" onmouseout=\"this.className='" + this._cssShowChangerPlay + "'\" src=\"" + this.pixelSrc + "\" border=\"0\" />");
                                    writer.Write("</td>");
                                    writer.Write("<td>");
                                    writer.Write("<img alt=\"" + this.Changer.MoveLeftTitle + "\" title=\"" + this.Changer.MoveLeftTitle + "\" onclick=\"" + this.ClientID + ".MoveBackward();\" class=\"" + this._cssShowChangerLeft + "\" onmouseover=\"this.className='" + this._cssShowChangerLeftOver + "'\" onmouseout=\"this.className='" + this._cssShowChangerLeft + "'\" src=\"" + this.pixelSrc + "\" border=\"0\" />");
                                    writer.Write("</td>");
                                    writer.Write("<td>");
                                    writer.Write("<img alt=\"" + this.Changer.MoveRightTitle + "\" title=\"" + this.Changer.MoveRightTitle + "\" onclick=\"" + this.ClientID + ".MoveForward();\" class=\"" + this._cssShowChangerRight + "\" onmouseover=\"this.className='" + this._cssShowChangerRightOver + "'\" onmouseout=\"this.className='" + this._cssShowChangerRight + "'\" src=\"" + this.pixelSrc + "\" border=\"0\" />");
                                    writer.Write("</td>");
                                }
                                else
                                {
                                    writer.Write("<td>");
                                    writer.Write("<img alt=\"" + this.Changer.MoveLeftTitle + "\" title=\"" + this.Changer.MoveLeftTitle + "\" onclick=\"" + this.ClientID + ".MoveBackward();\" class=\"" + this._cssShowChangerLeft + "\" onmouseover=\"this.className='" + this._cssShowChangerLeftOver + "'\" onmouseout=\"this.className='" + this._cssShowChangerLeft + "'\" src=\"" + this.pixelSrc + "\" border=\"0\" />");
                                    writer.Write("</td>");
                                    writer.Write("<td>");
                                    writer.Write("<img alt=\"" + this.Changer.MoveRightTitle + "\" title=\"" + this.Changer.MoveRightTitle + "\" onclick=\"" + this.ClientID + ".MoveForward();\" class=\"" + this._cssShowChangerRight + "\" onmouseover=\"this.className='" + this._cssShowChangerRightOver + "'\" onmouseout=\"this.className='" + this._cssShowChangerRight + "'\" src=\"" + this.pixelSrc + "\" border=\"0\" />");
                                    writer.Write("</td>");
                                }
                                writer.Write("</tr></table>");
                                break;

                            case ArrowType.BothSides:
                                writer.Write("<table cellpadding=\"0\" cellspacing=\"0\"><tr>");
                                if (this.ShowType != OboutInc.Show.ShowType.Show)
                                {
                                    writer.Write("<td>");
                                    writer.Write("<img alt=\"" + this.Changer.MoveLeftTitle + "\" title=\"" + this.Changer.MoveLeftTitle + "\" onclick=\"" + this.ClientID + ".MoveBackward();\" class=\"" + this._cssShowChangerLeft + "\" onmouseover=\"this.className='" + this._cssShowChangerLeftOver + "'\" onmouseout=\"this.className='" + this._cssShowChangerLeft + "'\" src=\"" + this.pixelSrc + "\" border=\"0\" />");
                                    writer.Write("</td>");
                                }
                                else
                                {
                                    writer.Write("<td>");
                                    writer.Write("<img id=\"" + this.ClientID + "_autoplaypause\" alt=\"" + this.Changer.PauseTitle + "\" title=\"" + this.Changer.PauseTitle + "\" onclick=\"" + this.ClientID + ".PauseShow();\" class=\"" + this._cssShowChangerPause + "\" onmouseover=\"this.className='" + this._cssShowChangerPauseOver + "'\" onmouseout=\"this.className='" + this._cssShowChangerPause + "'\" src=\"" + this.pixelSrc + "\" border=\"0\" />");
                                    writer.Write("<img id=\"" + this.ClientID + "_autoplaystart\" style=\"display:none\" alt=\"" + this.Changer.StartTitle + "\" title=\"" + this.Changer.StartTitle + "\" onclick=\"" + this.ClientID + ".PlayShow();\" class=\"" + this._cssShowChangerPlay + "\" onmouseover=\"this.className='" + this._cssShowChangerPlayOver + "'\" onmouseout=\"this.className='" + this._cssShowChangerPlay + "'\" src=\"" + this.pixelSrc + "\" border=\"0\" />");
                                    writer.Write("</td>");
                                    writer.Write("<td>");
                                    writer.Write("<img alt=\"" + this.Changer.MoveLeftTitle + "\" title=\"" + this.Changer.MoveLeftTitle + "\" onclick=\"" + this.ClientID + ".MoveBackward();\" class=\"" + this._cssShowChangerLeft + "\" onmouseover=\"this.className='" + this._cssShowChangerLeftOver + "'\" onmouseout=\"this.className='" + this._cssShowChangerLeft + "'\" src=\"" + this.pixelSrc + "\" border=\"0\" />");
                                    writer.Write("</td>");
                                }
                                for (int m = 0; m < this.Panels.Count; m++)
                                {
                                    writer.Write("<td style=\"vertical-align:middle;text-align:center\"><table cellpadding=\"0\" cellspacing=\"0\"><tr>");
                                    writer.Write(string.Concat(new object[] { "<td id=\"", this.ClientID, "_panelnumber_", m, "\" onclick=\"", this.ClientID, ".MoveToPanel(", m + 1, ")\" style=\"vertical-align:middle;text-align:center\">" }));
                                    writer.Write((int) (m + 1));
                                    writer.Write("</td>");
                                    writer.Write("</tr></table></td>");
                                }
                                if (this.ShowType == OboutInc.Show.ShowType.Show)
                                {
                                    writer.Write("<td>");
                                    writer.Write("<img alt=\"" + this.Changer.MoveRightTitle + "\" title=\"" + this.Changer.MoveRightTitle + "\" onclick=\"" + this.ClientID + ".MoveForward();\" class=\"" + this._cssShowChangerRight + "\" onmouseover=\"this.className='" + this._cssShowChangerRightOver + "'\" onmouseout=\"this.className='" + this._cssShowChangerRight + "'\" src=\"" + this.pixelSrc + "\" border=\"0\" />");
                                    writer.Write("</td>");
                                }
                                else
                                {
                                    writer.Write("<td>");
                                    writer.Write("<img alt=\"" + this.Changer.MoveRightTitle + "\" title=\"" + this.Changer.MoveRightTitle + "\" onclick=\"" + this.ClientID + ".MoveForward();\" class=\"" + this._cssShowChangerRight + "\" onmouseover=\"this.className='" + this._cssShowChangerRightOver + "'\" onmouseout=\"this.className='" + this._cssShowChangerRight + "'\" src=\"" + this.pixelSrc + "\" border=\"0\" />");
                                    writer.Write("</td>");
                                }
                                writer.Write("</tr></table>");
                                break;
                        }
                    }
                    goto Label_1E0E;

                default:
                    goto Label_2E32;
            }
        Label_11CF:
            num3 = 0;
            while (num3 < this.Panels.Count)
            {
                writer.Write("<td style=\"vertical-align:middle;text-align:center\"><table cellpadding=\"0\" cellspacing=\"0\"><tr>");
                writer.Write(string.Concat(new object[] { "<td id=\"", this.ClientID, "_panelnumber_", num3, "\" onclick=\"", this.ClientID, ".MoveToPanel(", num3 + 1, ")\" style=\"vertical-align:middle;text-align:center\">" }));
                writer.Write((int) (num3 + 1));
                writer.Write("</td>");
                writer.Write("</tr></table></td>");
                num3++;
            }
            writer.Write("</tr></table>");
        Label_1E0E:
            if ((this.Changer.Position == ChangerPosition.Left) || (this.Changer.Position == ChangerPosition.Right))
            {
                switch (this.Changer.ArrowType)
                {
                    case ArrowType.Side1:
                        writer.Write("<div align=\"center\">");
                        if (this.ShowType != OboutInc.Show.ShowType.Show)
                        {
                            writer.Write("<img alt=\"" + this.Changer.MoveLeftTitle + "\" title=\"" + this.Changer.MoveLeftTitle + "\" onclick=\"" + this.ClientID + ".MoveBackward();\" class=\"" + this._cssShowChangerTop + "\" onmouseover=\"this.className='" + this._cssShowChangerTopOver + "'\" onmouseout=\"this.className='" + this._cssShowChangerTop + "'\" src=\"" + this.pixelSrc + "\" border=\"0\" style=\"display:block\" />");
                            writer.Write("<img alt=\"" + this.Changer.MoveRightTitle + "\" title=\"" + this.Changer.MoveRightTitle + "\" onclick=\"" + this.ClientID + ".MoveForward();\" class=\"" + this._cssShowChangerBottom + "\" onmouseover=\"this.className='" + this._cssShowChangerBottomOver + "'\" onmouseout=\"this.className='" + this._cssShowChangerBottom + "'\" src=\"" + this.pixelSrc + "\" border=\"0\" />");
                        }
                        else
                        {
                            writer.Write("<img id=\"" + this.ClientID + "_autoplaypause\" alt=\"" + this.Changer.PauseTitle + "\" title=\"" + this.Changer.PauseTitle + "\" onclick=\"" + this.ClientID + ".PauseShow();\" class=\"" + this._cssShowChangerPause + "\" onmouseover=\"this.className='" + this._cssShowChangerPauseOver + "'\" onmouseout=\"this.className='" + this._cssShowChangerPause + "'\" src=\"" + this.pixelSrc + "\" border=\"0\" />");
                            writer.Write("<img id=\"" + this.ClientID + "_autoplaystart\" style=\"display:none\" alt=\"" + this.Changer.StartTitle + "\" title=\"" + this.Changer.StartTitle + "\" onclick=\"" + this.ClientID + ".PlayShow();\" class=\"" + this._cssShowChangerPlay + "\" onmouseover=\"this.className='" + this._cssShowChangerPlayOver + "'\" onmouseout=\"this.className='" + this._cssShowChangerPlay + "'\" src=\"" + this.pixelSrc + "\" border=\"0\" />");
                            writer.Write("<img alt=\"" + this.Changer.MoveLeftTitle + "\" title=\"" + this.Changer.MoveLeftTitle + "\" onclick=\"" + this.ClientID + ".MoveBackward();\" class=\"" + this._cssShowChangerTop + "\" onmouseover=\"this.className='" + this._cssShowChangerTopOver + "'\" onmouseout=\"this.className='" + this._cssShowChangerTop + "'\" src=\"" + this.pixelSrc + "\" border=\"0\" style=\"display:block\" />");
                            writer.Write("<img alt=\"" + this.Changer.MoveRightTitle + "\" title=\"" + this.Changer.MoveRightTitle + "\" onclick=\"" + this.ClientID + ".MoveForward();\" class=\"" + this._cssShowChangerBottom + "\" onmouseover=\"this.className='" + this._cssShowChangerBottomOver + "'\" onmouseout=\"this.className='" + this._cssShowChangerBottom + "'\" src=\"" + this.pixelSrc + "\" border=\"0\" />");
                        }
                        for (int n = 0; n < this.Panels.Count; n++)
                        {
                            writer.Write("<table cellpadding=\"0\" cellspacing=\"0\"><tr>");
                            writer.Write(string.Concat(new object[] { "<td id=\"", this.ClientID, "_panelnumber_", n, "\" onclick=\"", this.ClientID, ".MoveToPanel(", n + 1, ")\" style=\"vertical-align:middle;text-align:center\">" }));
                            writer.Write((int) (n + 1));
                            writer.Write("</td>");
                            writer.Write("</tr></table>");
                        }
                        writer.Write("</div>");
                        break;

                    case ArrowType.Side2:
                        writer.Write("<div align=\"center\">");
                        for (int num7 = 0; num7 < this.Panels.Count; num7++)
                        {
                            writer.Write("<table cellpadding=\"0\" cellspacing=\"0\"><tr>");
                            writer.Write(string.Concat(new object[] { "<td id=\"", this.ClientID, "_panelnumber_", num7, "\" onclick=\"", this.ClientID, ".MoveToPanel(", num7 + 1, ")\" style=\"vertical-align:middle;text-align:center\">" }));
                            writer.Write((int) (num7 + 1));
                            writer.Write("</td>");
                            writer.Write("</tr></table>");
                        }
                        if (this.ShowType == OboutInc.Show.ShowType.Show)
                        {
                            writer.Write("<img id=\"" + this.ClientID + "_autoplaypause\" alt=\"" + this.Changer.PauseTitle + "\" title=\"" + this.Changer.PauseTitle + "\" onclick=\"" + this.ClientID + ".PauseShow();\" class=\"" + this._cssShowChangerPause + "\" onmouseover=\"this.className='" + this._cssShowChangerPauseOver + "'\" onmouseout=\"this.className='" + this._cssShowChangerPause + "'\" src=\"" + this.pixelSrc + "\" border=\"0\" />");
                            writer.Write("<img id=\"" + this.ClientID + "_autoplaystart\" style=\"display:none\" alt=\"" + this.Changer.StartTitle + "\" title=\"" + this.Changer.StartTitle + "\" onclick=\"" + this.ClientID + ".PlayShow();\" class=\"" + this._cssShowChangerPlay + "\" onmouseover=\"this.className='" + this._cssShowChangerPlayOver + "'\" onmouseout=\"this.className='" + this._cssShowChangerPlay + "'\" src=\"" + this.pixelSrc + "\" border=\"0\" />");
                            writer.Write("<img alt=\"" + this.Changer.MoveLeftTitle + "\" title=\"" + this.Changer.MoveLeftTitle + "\" onclick=\"" + this.ClientID + ".MoveBackward();\" class=\"" + this._cssShowChangerTop + "\" onmouseover=\"this.className='" + this._cssShowChangerTopOver + "'\" onmouseout=\"this.className='" + this._cssShowChangerTop + "'\" src=\"" + this.pixelSrc + "\" border=\"0\" style=\"display:block\" />");
                            writer.Write("<img alt=\"" + this.Changer.MoveRightTitle + "\" title=\"" + this.Changer.MoveRightTitle + "\" onclick=\"" + this.ClientID + ".MoveForward();\" class=\"" + this._cssShowChangerBottom + "\" onmouseover=\"this.className='" + this._cssShowChangerBottomOver + "'\" onmouseout=\"this.className='" + this._cssShowChangerBottom + "'\" src=\"" + this.pixelSrc + "\" border=\"0\" />");
                        }
                        else
                        {
                            writer.Write("<img alt=\"" + this.Changer.MoveLeftTitle + "\" title=\"" + this.Changer.MoveLeftTitle + "\" onclick=\"" + this.ClientID + ".MoveBackward();\" class=\"" + this._cssShowChangerTop + "\" onmouseover=\"this.className='" + this._cssShowChangerTopOver + "'\" onmouseout=\"this.className='" + this._cssShowChangerTop + "'\" src=\"" + this.pixelSrc + "\" border=\"0\" style=\"display:block\" />");
                            writer.Write("<img alt=\"" + this.Changer.MoveRightTitle + "\" title=\"" + this.Changer.MoveRightTitle + "\" onclick=\"" + this.ClientID + ".MoveForward();\" class=\"" + this._cssShowChangerBottom + "\" onmouseover=\"this.className='" + this._cssShowChangerBottomOver + "'\" onmouseout=\"this.className='" + this._cssShowChangerBottom + "'\" src=\"" + this.pixelSrc + "\" border=\"0\" />");
                        }
                        writer.Write("</div>");
                        break;

                    case ArrowType.BothSides:
                        writer.Write("<div align=\"center\">");
                        if (this.ShowType != OboutInc.Show.ShowType.Show)
                        {
                            writer.Write("<img alt=\"" + this.Changer.MoveLeftTitle + "\" title=\"" + this.Changer.MoveLeftTitle + "\" onclick=\"" + this.ClientID + ".MoveBackward();\" class=\"" + this._cssShowChangerTop + "\" onmouseover=\"this.className='" + this._cssShowChangerTopOver + "'\" onmouseout=\"this.className='" + this._cssShowChangerTop + "'\" src=\"" + this.pixelSrc + "\" border=\"0\" />");
                        }
                        else
                        {
                            writer.Write("<img id=\"" + this.ClientID + "_autoplaypause\" alt=\"" + this.Changer.PauseTitle + "\" title=\"" + this.Changer.PauseTitle + "\" onclick=\"" + this.ClientID + ".PauseShow();\" class=\"" + this._cssShowChangerPause + "\" onmouseover=\"this.className='" + this._cssShowChangerPauseOver + "'\" onmouseout=\"this.className='" + this._cssShowChangerPause + "'\" src=\"" + this.pixelSrc + "\" border=\"0\" />");
                            writer.Write("<img id=\"" + this.ClientID + "_autoplaystart\" style=\"display:none\" alt=\"" + this.Changer.StartTitle + "\" title=\"" + this.Changer.StartTitle + "\" onclick=\"" + this.ClientID + ".PlayShow();\" class=\"" + this._cssShowChangerPlay + "\" onmouseover=\"this.className='" + this._cssShowChangerPlayOver + "'\" onmouseout=\"this.className='" + this._cssShowChangerPlay + "'\" src=\"" + this.pixelSrc + "\" border=\"0\" />");
                            writer.Write("<img alt=\"" + this.Changer.MoveLeftTitle + "\" title=\"" + this.Changer.MoveLeftTitle + "\" onclick=\"" + this.ClientID + ".MoveBackward();\" class=\"" + this._cssShowChangerTop + "\" onmouseover=\"this.className='" + this._cssShowChangerTopOver + "'\" onmouseout=\"this.className='" + this._cssShowChangerTop + "'\" src=\"" + this.pixelSrc + "\" border=\"0\" />");
                        }
                        for (int num8 = 0; num8 < this.Panels.Count; num8++)
                        {
                            writer.Write("<table cellpadding=\"0\" cellspacing=\"0\"><tr>");
                            writer.Write(string.Concat(new object[] { "<td id=\"", this.ClientID, "_panelnumber_", num8, "\" onclick=\"", this.ClientID, ".MoveToPanel(", num8 + 1, ")\" style=\"vertical-align:middle;text-align:center\">" }));
                            writer.Write((int) (num8 + 1));
                            writer.Write("</td>");
                            writer.Write("</tr></table>");
                        }
                        if (this.ShowType == OboutInc.Show.ShowType.Show)
                        {
                            writer.Write("<img alt=\"" + this.Changer.MoveRightTitle + "\" title=\"" + this.Changer.MoveRightTitle + "\" onclick=\"" + this.ClientID + ".MoveForward();\" class=\"" + this._cssShowChangerBottom + "\" onmouseover=\"this.className='" + this._cssShowChangerBottomOver + "'\" onmouseout=\"this.className='" + this._cssShowChangerBottom + "'\" src=\"" + this.pixelSrc + "\" border=\"0\" />");
                        }
                        else
                        {
                            writer.Write("<img alt=\"" + this.Changer.MoveRightTitle + "\" title=\"" + this.Changer.MoveRightTitle + "\" onclick=\"" + this.ClientID + ".MoveForward();\" class=\"" + this._cssShowChangerBottom + "\" onmouseover=\"this.className='" + this._cssShowChangerBottomOver + "'\" onmouseout=\"this.className='" + this._cssShowChangerBottom + "'\" src=\"" + this.pixelSrc + "\" border=\"0\" />");
                        }
                        writer.Write("</div>");
                        break;
                }
            }
        Label_2E32:
            if ((this.Changer.Position == ChangerPosition.Left) || (this.Changer.Position == ChangerPosition.Right))
            {
                writer.Write("</td>");
                writer.Write("</tr>");
                writer.Write("</table>");
            }
            else
            {
                writer.Write("</td>");
                writer.Write("</tr>");
                writer.Write("</table>");
            }
            writer.Write("</div>");
        }

        private void RenderPanels(HtmlTextWriter writer)
        {
            writer.Write("<div style=\"" + (this.Changer.AllowAbsolutePosition ? "" : "position:relative;") + "overflow:hidden;width:" + this.panelWidth + ";height:" + this.panelHeight + "\">");
            if ((this.Panels != null) && (this.Panels.Count > 0))
            {
                int num = 0;
                foreach (OboutInc.Show.Panel panel in this.Panels)
                {
                    switch (panel.PanelType)
                    {
                        case PanelType.InnerHtml:
                            writer.Write("<div class=\"" + this._cssShowPanel + "\" id=\"" + this.ClientID + "_" + num.ToString() + "\" style=\"position:absolute;width:" + this.panelWidth + ";height:" + this.panelHeight + ";\">");
                            panel.RenderControl(writer);
                            writer.Write("</div>");
                            break;

                        case PanelType.ImagePath:
                            writer.Write("<div imagepath=\"" + panel.ImagePath + "\" imagetitle=\"" + panel.ImageTitle + "\" imagewidth=\"" + panel.ImageWidth + "\" imageheight=\"" + panel.ImageHeight + "\" class=\"" + this._cssShowPanel + "\" id=\"" + this.ClientID + "_" + num.ToString() + "\" style=\"position:absolute;width:" + this.panelWidth + ";height:" + this.panelHeight + ";\">");
                            writer.Write("</div>");
                            break;

                        case PanelType.Url:
                        {
                            writer.Write("<div class=\"" + this._cssShowPanel + "\" id=\"" + this.ClientID + "_" + num.ToString() + "\" style=\"position:absolute;width:" + this.panelWidth + ";height:" + this.panelHeight + ";\">");
                            string str = (panel.URLPanel_OnLoadScript != string.Empty) ? string.Format("onload=\"{0}\"", panel.URLPanel_OnLoadScript) : string.Empty;
                            writer.Write("<iframe " + str + " id=\"iframe_" + this.ClientID + "_" + num.ToString() + "\" src=\"" + panel.Url + "\" style=\"width:100%;height:100%;border:0px;\" frameBorder=\"0\"></iframe>");
                            writer.Write("</div>");
                            break;
                        }
                    }
                    num++;
                }
            }
            writer.Write("</div>");
        }

        private void RenderPanelWithChanger(HtmlTextWriter writer)
        {
            switch (this.Changer.Position)
            {
                case ChangerPosition.Top:
                    this.changerWidth = "100%";
                    this.changerHeight = this.Changer.Height + "px";
                    this.changerAlign = this.Changer.HorizontalAlign.ToString().ToLower();
                    writer.Write("<tr>");
                    writer.Write(string.Concat(new object[] { "<td style=\"text-align:", this.Changer.HorizontalAlign, ";vertical-align:middle;width:", this.changerWidth, ";height:", this.changerHeight, ";\">" }));
                    this.RenderChangerPanel(writer);
                    writer.Write("</td>");
                    writer.Write("</tr>");
                    writer.Write("<tr>");
                    writer.Write("<td style='width:100%;height:100%'>");
                    this.RenderPanels(writer);
                    writer.Write("</td>");
                    writer.Write("</tr>");
                    return;

                case ChangerPosition.Bottom:
                    this.changerWidth = "100%";
                    this.changerHeight = this.Changer.Height + "px";
                    this.changerAlign = this.Changer.HorizontalAlign.ToString().ToLower();
                    writer.Write("<tr>");
                    writer.Write("<td style='width:100%;height:100%'>");
                    this.RenderPanels(writer);
                    writer.Write("</td>");
                    writer.Write("</tr>");
                    writer.Write("<tr>");
                    writer.Write(string.Concat(new object[] { "<td style=\"text-align:", this.Changer.HorizontalAlign, ";vertical-align:middle;", this.Changer.AllowAbsolutePosition ? "" : "position:relative;", "width:", this.changerWidth, ";height:", this.changerHeight, ";\">" }));
                    this.RenderChangerPanel(writer);
                    writer.Write("</td>");
                    writer.Write("</tr>");
                    return;

                case ChangerPosition.Left:
                    this.changerWidth = this.Changer.Width + "px";
                    this.changerHeight = "100%";
                    this.changerAlign = this.Changer.VerticalAlign.ToString().ToLower();
                    writer.Write("<tr>");
                    writer.Write(string.Concat(new object[] { "<td style=\"text-align:center;vertical-align:", this.Changer.VerticalAlign, ";width:", this.changerWidth, ";height:", this.changerHeight, ";\">" }));
                    this.RenderChangerPanel(writer);
                    writer.Write("</td>");
                    writer.Write("<td style='width:100%;height:100%'>");
                    this.RenderPanels(writer);
                    writer.Write("</td>");
                    writer.Write("</tr>");
                    return;

                case ChangerPosition.Right:
                    this.changerWidth = this.Changer.Width + "px";
                    this.changerHeight = "100%";
                    this.changerAlign = this.Changer.VerticalAlign.ToString().ToLower();
                    writer.Write("<tr>");
                    writer.Write("<td style='width:100%;height:100%'>");
                    this.RenderPanels(writer);
                    writer.Write("</td>");
                    writer.Write(string.Concat(new object[] { "<td style=\"text-align:center;vertical-align:", this.Changer.VerticalAlign, ";width:", this.changerWidth, ";height:", this.changerHeight, ";\">" }));
                    this.RenderChangerPanel(writer);
                    writer.Write("</td>");
                    writer.Write("</tr>");
                    return;
            }
        }

        protected override object SaveViewState()
        {
            this.serializeChanger();
            return base.SaveViewState();
        }

        private void serializeChanger()
        {
            XmlDocument document = new XmlDocument();
            XmlElement newChild = document.CreateElement("Changer", "");
            XmlElement parentNode = document.CreateElement(this.ID, "");
            this.Changer.Serialize(ref parentNode);
            newChild.AppendChild(parentNode);
            document.AppendChild(newChild);
            this.ViewState["Show_Changer"] = document.OuterXml;
        }

        void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context)
        {
        }

        [PersistenceMode(PersistenceMode.InnerProperty), Category("Behavior"), Description("The panels changer"), DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
        public OboutInc.Show.Changer Changer
        {
            get
            {
                if (this.ViewState["Changer"] == null)
                {
                    this.ViewState["Changer"] = new OboutInc.Show.Changer();
                }
                return (OboutInc.Show.Changer) this.ViewState["Changer"];
            }
            set
            {
                this.ViewState["Changer"] = value;
            }
        }

        public override string ClientID
        {
            get
            {
                if (this._ClientID == string.Empty)
                {
                    if (base.ID == null)
                    {
                        this._ClientID = "Show_" + base.ClientID;
                    }
                    else
                    {
                        this._ClientID = base.ID;
                    }
                }
                return this._ClientID;
            }
        }

        public string ComponentVersion
        {
            get
            {
                return Constants.myVersion;
            }
        }

        [DefaultValue(""), Description("Full path to CSS file."), Bindable(true), Category("Show appearance")]
        public string CSSPath
        {
            get
            {
                string str = (string) this.ViewState["CSSPath"];
                if (str != null)
                {
                    return str;
                }
                return string.Empty;
            }
            set
            {
                this.ViewState["CSSPath"] = value;
            }
        }

        [Description("CSS class name for panels changer."), Bindable(true), Category("Show appearance"), DefaultValue("")]
        public string CSSShowChanger
        {
            get
            {
                string str = (string) this.ViewState["CSSShowChanger"];
                if (str != null)
                {
                    return str;
                }
                return string.Empty;
            }
            set
            {
                this.ViewState["CSSShowChanger"] = value;
            }
        }

        [Category("Show appearance"), Bindable(true), Description("CSS class name for panels changer bottom."), DefaultValue("")]
        public string CSSShowChangerBottom
        {
            get
            {
                string str = (string) this.ViewState["CSSShowChangerBottom"];
                if (str != null)
                {
                    return str;
                }
                return string.Empty;
            }
            set
            {
                this.ViewState["CSSShowChangerBottom"] = value;
            }
        }

        [Bindable(true), Description("CSS class name for panels changer bottom when mouse is over."), Category("Show appearance"), DefaultValue("")]
        public string CSSShowChangerBottomOver
        {
            get
            {
                string str = (string) this.ViewState["CSSShowChangerBottomOver"];
                if (str != null)
                {
                    return str;
                }
                return string.Empty;
            }
            set
            {
                this.ViewState["CSSShowChangerBottomOver"] = value;
            }
        }

        [DefaultValue(""), Description("CSS class name for panels changer left."), Bindable(true), Category("Show appearance")]
        public string CSSShowChangerLeft
        {
            get
            {
                string str = (string) this.ViewState["CSSShowChangerLeft"];
                if (str != null)
                {
                    return str;
                }
                return string.Empty;
            }
            set
            {
                this.ViewState["CSSShowChangerLeft"] = value;
            }
        }

        [DefaultValue(""), Description("CSS class name for panels changer left when mouse is over."), Category("Show appearance"), Bindable(true)]
        public string CSSShowChangerLeftOver
        {
            get
            {
                string str = (string) this.ViewState["CSSShowChangerLeftOver"];
                if (str != null)
                {
                    return str;
                }
                return string.Empty;
            }
            set
            {
                this.ViewState["CSSShowChangerLeftOver"] = value;
            }
        }

        [Category("Show appearance"), Bindable(true), DefaultValue(""), Description("CSS class name for panels changer number.")]
        public string CSSShowChangerNumber
        {
            get
            {
                string str = (string) this.ViewState["CSSShowChangerNumber"];
                if (str != null)
                {
                    return str;
                }
                return string.Empty;
            }
            set
            {
                this.ViewState["CSSShowChangerNumber"] = value;
            }
        }

        [DefaultValue(""), Category("Show appearance"), Bindable(true), Description("CSS class name for panels changer number over.")]
        public string CSSShowChangerNumberOver
        {
            get
            {
                string str = (string) this.ViewState["CSSShowChangerNumberOver"];
                if (str != null)
                {
                    return str;
                }
                return string.Empty;
            }
            set
            {
                this.ViewState["CSSShowChangerNumberOver"] = value;
            }
        }

        [Bindable(true), Category("Show appearance"), DefaultValue(""), Description("CSS class name for panels changer number when is selected.")]
        public string CSSShowChangerNumberSelected
        {
            get
            {
                string str = (string) this.ViewState["CSSShowChangerNumberSelected"];
                if (str != null)
                {
                    return str;
                }
                return string.Empty;
            }
            set
            {
                this.ViewState["CSSShowChangerNumberSelected"] = value;
            }
        }

        [Category("Show appearance"), Description("CSS class name for panels changer pause button."), DefaultValue(""), Bindable(true)]
        public string CSSShowChangerPause
        {
            get
            {
                string str = (string) this.ViewState["CSSShowChangerPause"];
                if (str != null)
                {
                    return str;
                }
                return string.Empty;
            }
            set
            {
                this.ViewState["CSSShowChangerPause"] = value;
            }
        }

        [Bindable(true), DefaultValue(""), Description("CSS class name for panels changer pause button when mouse is over."), Category("Show appearance")]
        public string CSSShowChangerPauseOver
        {
            get
            {
                string str = (string) this.ViewState["CSSShowChangerPauseOver"];
                if (str != null)
                {
                    return str;
                }
                return string.Empty;
            }
            set
            {
                this.ViewState["CSSShowChangerPauseOver"] = value;
            }
        }

        [Description("CSS class name for panels changer play button."), DefaultValue(""), Bindable(true), Category("Show appearance")]
        public string CSSShowChangerPlay
        {
            get
            {
                string str = (string) this.ViewState["CSSShowChangerPlay"];
                if (str != null)
                {
                    return str;
                }
                return string.Empty;
            }
            set
            {
                this.ViewState["CSSShowChangerPlay"] = value;
            }
        }

        [Description("CSS class name for panels changer play button when mouse is over."), DefaultValue(""), Bindable(true), Category("Show appearance")]
        public string CSSShowChangerPlayOver
        {
            get
            {
                string str = (string) this.ViewState["CSSShowChangerPlayOver"];
                if (str != null)
                {
                    return str;
                }
                return string.Empty;
            }
            set
            {
                this.ViewState["CSSShowChangerPlayOver"] = value;
            }
        }

        [Description("CSS class name for panels changer right."), Bindable(true), Category("Show appearance"), DefaultValue("")]
        public string CSSShowChangerRight
        {
            get
            {
                string str = (string) this.ViewState["CSSShowChangerRight"];
                if (str != null)
                {
                    return str;
                }
                return string.Empty;
            }
            set
            {
                this.ViewState["CSSShowChangerRight"] = value;
            }
        }

        [Description("CSS class name for panels changer right when mouse is over."), Bindable(true), Category("Show appearance"), DefaultValue("")]
        public string CSSShowChangerRightOver
        {
            get
            {
                string str = (string) this.ViewState["CSSShowChangerRightOver"];
                if (str != null)
                {
                    return str;
                }
                return string.Empty;
            }
            set
            {
                this.ViewState["CSSShowChangerRightOver"] = value;
            }
        }

        [Description("CSS class name for panels changer top."), Bindable(true), Category("Show appearance"), DefaultValue("")]
        public string CSSShowChangerTop
        {
            get
            {
                string str = (string) this.ViewState["CSSShowChangerTop"];
                if (str != null)
                {
                    return str;
                }
                return string.Empty;
            }
            set
            {
                this.ViewState["CSSShowChangerTop"] = value;
            }
        }

        [Description("CSS class name for panels changer top when mouse is over."), Bindable(true), Category("Show appearance"), DefaultValue("")]
        public string CSSShowChangerTopOver
        {
            get
            {
                string str = (string) this.ViewState["CSSShowChangerTopOver"];
                if (str != null)
                {
                    return str;
                }
                return string.Empty;
            }
            set
            {
                this.ViewState["CSSShowChangerTopOver"] = value;
            }
        }

        [Description("CSS class name for panel."), Bindable(true), Category("Show appearance"), DefaultValue("")]
        public string CSSShowPanel
        {
            get
            {
                string str = (string) this.ViewState["CSSShowPanel"];
                if (str != null)
                {
                    return str;
                }
                return string.Empty;
            }
            set
            {
                this.ViewState["CSSShowPanel"] = value;
            }
        }

        [Bindable(true), Category("Show appearance"), DefaultValue(""), Description("CSS class name for panels holder.")]
        public string CSSShowPanelsHolder
        {
            get
            {
                string str = (string) this.ViewState["CSSShowPanelsHolder"];
                if (str != null)
                {
                    return str;
                }
                return string.Empty;
            }
            set
            {
                this.ViewState["CSSShowPanelsHolder"] = value;
            }
        }

        [Description("if true, begin by fading into the first panel (available when TransitionType = Fading)"), Bindable(true), Category("Show appearance"), DefaultValue(false)]
        public bool FadeFirstPanel
        {
            get
            {
                if (this.ViewState["FadeFirstPanel"] == null)
                {
                    this.ViewState["FadeFirstPanel"] = false;
                }
                return (bool) this.ViewState["FadeFirstPanel"];
            }
            set
            {
                this.ViewState["FadeFirstPanel"] = value;
            }
        }

        [Bindable(true), DefaultValue(0x3e8), Description("speed of fading(lower value = slower)"), Category("Show appearance")]
        public int FadingSpeed
        {
            get
            {
                if (this.ViewState["FadingSpeed"] == null)
                {
                    this.ViewState["FadingSpeed"] = 0x3e8;
                }
                return (int) this.ViewState["FadingSpeed"];
            }
            set
            {
                this.ViewState["FadingSpeed"] = value;
            }
        }

        [DefaultValue(3), Description("step of fading(lower value = slower)"), Bindable(true), Category("Show appearance")]
        public int FadingStep
        {
            get
            {
                if (this.ViewState["FadingStep"] == null)
                {
                    this.ViewState["FadingStep"] = 3;
                }
                return (int) this.ViewState["FadingStep"];
            }
            set
            {
                this.ViewState["FadingStep"] = value;
            }
        }

        [DefaultValue(false), Bindable(true), Description("allow scrolling only in the first defined direction"), Category("Show appearance")]
        public bool FixedScrolling
        {
            get
            {
                if (this.ViewState["FixedScrolling"] == null)
                {
                    this.ViewState["FixedScrolling"] = false;
                }
                return (bool) this.ViewState["FixedScrolling"];
            }
            set
            {
                this.ViewState["FixedScrolling"] = value;
            }
        }

        [DefaultValue("300px"), Description("height of the show container"), Category("Show appearance"), Bindable(true)]
        public string Height
        {
            get
            {
                if (this.ViewState["Height"] == null)
                {
                    this.ViewState["Height"] = "300px";
                }
                return (string) this.ViewState["Height"];
            }
            set
            {
                Regex regex = new Regex(@"(\d)+px");
                Regex regex2 = new Regex(@"(\d)+%");
                Regex regex3 = new Regex(@"(\d)+");
                if (regex.IsMatch(value) || regex2.IsMatch(value))
                {
                    this.ViewState["Height"] = value;
                }
                else if (regex3.IsMatch(value))
                {
                    this.ViewState["Height"] = value + "px";
                }
                else
                {
                    this.ViewState["Height"] = "300px";
                }
            }
        }

        [Description("If true, the images will fit the available show size."), Bindable(true), Category("Show appearance"), DefaultValue(false)]
        public bool ImagesFitAvailableSize
        {
            get
            {
                if (this.ViewState["ImagesFitAvailableSize"] == null)
                {
                    this.ViewState["ImagesFitAvailableSize"] = false;
                }
                return (bool) this.ViewState["ImagesFitAvailableSize"];
            }
            set
            {
                this.ViewState["ImagesFitAvailableSize"] = value;
            }
        }

        [Category("Show settings"), Bindable(true), DefaultValue(""), Description("Path to folder with images to be used in show.")]
        public string ImagesShowPath
        {
            get
            {
                string str = (string) this.ViewState["ImagesShowPath"];
                if (str != null)
                {
                    return str;
                }
                return "";
            }
            set
            {
                this.ViewState["ImagesShowPath"] = value.Replace(@"\", "/");
            }
        }

        [Category("Show settings"), Bindable(true), Description("The pattern for the images to be used in show. The default is .* to match any string."), DefaultValue(".*")]
        public string ImagesShowPattern
        {
            get
            {
                string str = (string) this.ViewState["ImagesShowPattern"];
                if (str != null)
                {
                    return str;
                }
                return ".*";
            }
            set
            {
                this.ViewState["ImagesShowPattern"] = value;
            }
        }

        [Bindable(true), DefaultValue(false), Description("if true, manual changer exists"), Category("Show appearance")]
        public bool ManualChanger
        {
            get
            {
                if (this.ViewState["ManualChanger"] == null)
                {
                    this.ViewState["ManualChanger"] = false;
                }
                return (bool) this.ViewState["ManualChanger"];
            }
            set
            {
                this.ViewState["ManualChanger"] = value;
            }
        }

        [Description("Content shown when JavaScript is disabled"), DesignerSerializationVisibility(DesignerSerializationVisibility.Content), PersistenceMode(PersistenceMode.InnerProperty), Category("Behavior")]
        public OboutInc.Show.NoJavaScript NoJavaScript
        {
            get
            {
                if (this.ViewState["NoJavaScript"] == null)
                {
                    this.ViewState["NoJavaScript"] = new OboutInc.Show.NoJavaScript();
                }
                return (OboutInc.Show.NoJavaScript) this.ViewState["NoJavaScript"];
            }
            set
            {
                this.ViewState["NoJavaScript"] = value;
            }
        }

        [Bindable(true), Description("The name of the client event for the panel change end."), Category("Show settings"), DefaultValue("ob_show_OnPanelChangeEnd")]
        public string OnPanelChangeEndEvent
        {
            get
            {
                string str = (string) this.ViewState["OnPanelChangeEndEvent"];
                if (str != null)
                {
                    return str;
                }
                return "ob_show_OnPanelChangeEnd";
            }
            set
            {
                this.ViewState["OnPanelChangeEndEvent"] = value;
            }
        }

        [DefaultValue("ob_show_OnPanelChangeStart"), Category("Show settings"), Description("The name of the client event for the panel change start."), Bindable(true)]
        public string OnPanelChangeStartEvent
        {
            get
            {
                string str = (string) this.ViewState["OnPanelChangeStartEvent"];
                if (str != null)
                {
                    return str;
                }
                return "ob_show_OnPanelChangeStart";
            }
            set
            {
                this.ViewState["OnPanelChangeStartEvent"] = value;
            }
        }

        [Editor(typeof(PanelCollectionEditor), typeof(UITypeEditor)), PersistenceMode(PersistenceMode.InnerProperty), NotifyParentProperty(true), DesignerSerializationVisibility(DesignerSerializationVisibility.Content), Category("Data"), Description("The panels collection")]
        public PanelBaseCollection Panels
        {
            get
            {
                if (this.ViewState["Panels"] == null)
                {
                    this.ViewState["Panels"] = new PanelBaseCollection();
                }
                return (PanelBaseCollection) this.ViewState["Panels"];
            }
        }

        [Bindable(true), Description("If true, in case of URL panel is used, every time is visible it will be refreshed."), Category("Show appearance"), DefaultValue(true)]
        public bool RefreshOnLoad
        {
            get
            {
                if (this.ViewState["RefreshOnLoad"] == null)
                {
                    this.ViewState["RefreshOnLoad"] = true;
                }
                return bool.Parse(this.ViewState["RefreshOnLoad"].ToString());
            }
            set
            {
                this.ViewState["RefreshOnLoad"] = value;
            }
        }

        [DefaultValue("ScrollDirection.Left"), Description("set scroll direction for the scroll transition type"), Category("Show appearance"), Bindable(true)]
        public OboutInc.Show.ScrollDirection ScrollDirection
        {
            get
            {
                if (this.ViewState["ScrollDirection"] == null)
                {
                    this.ViewState["ScrollDirection"] = OboutInc.Show.ScrollDirection.Left;
                }
                return (OboutInc.Show.ScrollDirection) this.ViewState["ScrollDirection"];
            }
            set
            {
                this.ViewState["ScrollDirection"] = value;
            }
        }

        [DefaultValue(100), Description("speed of scrolling(lower value = slower)"), Bindable(true), Category("Show appearance")]
        public int ScrollingSpeed
        {
            get
            {
                if (this.ViewState["ScrollingSpeed"] == null)
                {
                    this.ViewState["ScrollingSpeed"] = 100;
                }
                return (int) this.ViewState["ScrollingSpeed"];
            }
            set
            {
                this.ViewState["ScrollingSpeed"] = value;
            }
        }

        [DefaultValue(5), Description("step of scrolling(lower value = slower)"), Bindable(true), Category("Show appearance")]
        public int ScrollingStep
        {
            get
            {
                if (this.ViewState["ScrollingStep"] == null)
                {
                    this.ViewState["ScrollingStep"] = 5;
                }
                return (int) this.ViewState["ScrollingStep"];
            }
            set
            {
                this.ViewState["ScrollingStep"] = value;
            }
        }

        public int SelectedPanel
        {
            get
            {
                if (this.ViewState["SelectedPanel"] != null)
                {
                    return (int) this.ViewState["SelectedPanel"];
                }
                int num = 0;
                if ((this.Panels != null) && (this.Panels.Count > 0))
                {
                    foreach (OboutInc.Show.Panel panel in this.Panels)
                    {
                        if (panel.Selected)
                        {
                            return num;
                        }
                        num++;
                    }
                }
                return 0;
            }
            set
            {
                this.ViewState["SelectedPanel"] = value - 1;
            }
        }

        [DefaultValue("ShowType.Show"), Category("Show appearance"), Description("show type"), Bindable(true)]
        public OboutInc.Show.ShowType ShowType
        {
            get
            {
                if (this.ViewState["ShowType"] == null)
                {
                    this.ViewState["ShowType"] = OboutInc.Show.ShowType.Show;
                }
                return (OboutInc.Show.ShowType) this.ViewState["ShowType"];
            }
            set
            {
                this.ViewState["ShowType"] = value;
            }
        }

        [Bindable(true), Category("Show appearance"), DefaultValue("-1"), Description("Amount of time on first panel load (1000 = 1 second)")]
        public int StartTimeDelay
        {
            get
            {
                if (this.ViewState["StartTimeDelay"] == null)
                {
                    this.ViewState["StartTimeDelay"] = this.TimeBetweenPanels;
                }
                return (int) this.ViewState["StartTimeDelay"];
            }
            set
            {
                this.ViewState["StartTimeDelay"] = value;
            }
        }

        [Bindable(true), Description("if true, stop fading when mouse is over the Show"), Category("Show appearance"), DefaultValue(false)]
        public bool StopFading
        {
            get
            {
                if (this.ViewState["StopFading"] == null)
                {
                    this.ViewState["StopFading"] = false;
                }
                return (bool) this.ViewState["StopFading"];
            }
            set
            {
                this.ViewState["StopFading"] = value;
            }
        }

        [Description("if true, stop scrolling when mouse is over the Show (available when ShowType = Show)"), DefaultValue(false), Bindable(true), Category("Show appearance")]
        public bool StopScrolling
        {
            get
            {
                if (this.ViewState["StopScrolling"] == null)
                {
                    this.ViewState["StopScrolling"] = false;
                }
                return (bool) this.ViewState["StopScrolling"];
            }
            set
            {
                this.ViewState["StopScrolling"] = value;
            }
        }

        [Bindable(true), Description("Path to folder with show style."), Category("Show appearance"), DefaultValue("")]
        public string StyleFolder
        {
            get
            {
                string str = (string) this.ViewState["StyleFolder"];
                if (str != null)
                {
                    return str;
                }
                return "";
            }
            set
            {
                this.ViewState["StyleFolder"] = value;
            }
        }

        [Category("Show appearance"), DefaultValue("2000"), Description("Amount of time between each panel(1000 = 1 second)"), Bindable(true)]
        public int TimeBetweenPanels
        {
            get
            {
                if (this.ViewState["TimeBetweenPanels"] == null)
                {
                    this.ViewState["TimeBetweenPanels"] = 0x7d0;
                }
                return (int) this.ViewState["TimeBetweenPanels"];
            }
            set
            {
                this.ViewState["TimeBetweenPanels"] = value;
            }
        }

        [Bindable(true), Category("Show appearance"), DefaultValue("TransitionType.None"), Description("panels transitionn type")]
        public OboutInc.Show.TransitionType TransitionType
        {
            get
            {
                if (this.ViewState["TransitionType"] == null)
                {
                    this.ViewState["TransitionType"] = OboutInc.Show.TransitionType.None;
                }
                return (OboutInc.Show.TransitionType) this.ViewState["TransitionType"];
            }
            set
            {
                this.ViewState["TransitionType"] = value;
            }
        }

        public override string UniqueID
        {
            get
            {
                return base.UniqueID;
            }
        }

        [Bindable(true), Description("width of the show container"), Category("Show appearance"), DefaultValue("400px")]
        public string Width
        {
            get
            {
                if (this.ViewState["Width"] == null)
                {
                    this.ViewState["Width"] = "400px";
                }
                return (string) this.ViewState["Width"];
            }
            set
            {
                Regex regex = new Regex(@"(\d)+px");
                Regex regex2 = new Regex(@"(\d)+%");
                Regex regex3 = new Regex(@"(\d)+");
                if (regex.IsMatch(value) || regex2.IsMatch(value))
                {
                    this.ViewState["Width"] = value;
                }
                else if (regex3.IsMatch(value))
                {
                    this.ViewState["Width"] = value + "px";
                }
                else
                {
                    this.ViewState["Width"] = "400px";
                }
            }
        }
    }
}

